const mongoose = require('mongoose')

const Schema = mongoose.Schema

const CourseSchema = new Schema(
  {
    id: {
      type: String,
      unique: true,
      require: true
    },
    status: {
      type: String
    },
    publisher: {
      type: String,
      require: true
    },
    publisherHeader: {
      type: String
    },
    publisherName: {
      type: String
    },
    studentId: {
      type: String
    },
    schoolId: {
      type: String
    },
    school: {
      type: String
    },
    phone: {
      type: String
    },
    publisherTime: {
      type: String
    },
    closeTime: {
      type: String
    },
    remark: {
      type: String
    },
    receiver: {
      type: String
    },
    receiverName: {
      type: String
    },
    province: {
      type: Number
    },
    college: {
      type: String
    },
    major: {
      type: String
    },
    courseName: {
      type: String
    },
    courseTime: {
      type: String,
      require: true
    },
    courseClass: {
      type: String
    },
    coursePlace: {
      type: String,
      require: true
    },
    reward: {
      type: Number
    },
    hasName: {
      type: Boolean
    },
    hasStuId: {
      type: Boolean
    },
    hasPhone: {
      type: Boolean
    },
    hasReward: {
      type: Boolean
    }
  },
  { collection: 'courses', versionKey: false }
)
module.exports = mongoose.model('courses', CourseSchema)
